package com.aphrodite.io.sip.header;

import com.aphrodite.util.StringParser;

/**
 * SIP Header Call-ID. The Call-ID header field acts as a unique identifier to
 * group together a series of messages. It MUST be the same for all requests and
 * responses sent by either UA in a dialog. It SHOULD be the same in each
 * registration from a UA. <BR>
 * In a new request created by a UAC outside of any dialog, the Call-ID header
 * field MUST be selected by the UAC as a globally unique identifier over space
 * and time unless overridden by method-specific behavior. <BR>
 * Use of cryptographically random identifiers in the generation of Call-IDs is
 * RECOMMENDED. Implementations MAY use the form "localid@host". Call-IDs are
 * case-sensitive and are simply compared byte-by-byte.
 */
public final class CallIdHeader extends Header {
	/** Creates a new CallIdHeader equal to CallIdHeader <i>hd</i> */
	public CallIdHeader(Header hd) {
		super(hd);
	}

	/** Creates a CallIdHeader */
	// public CallIdHeader()
	// { super(SipHeaders.Call_ID);
	// }
	/** Creates a CallIdHeader with value <i>hvalue</i> */
	public CallIdHeader(String hvalue) {
		super(SipHeaders.Call_ID, hvalue);
	}

	/** Gets Call-Id of CallIdHeader */
	public String getCallId() {
		return (new StringParser(value)).getString();
	}

	/** Sets Call-Id of CallIdHeader */
	public void setCallId(String callId) {
		value = callId;
	}
}
